jQuery(document).ready(function() {
	//创建JQGRID表格
		$("#table1").ligerGrid({
        columns: [
                  { dispaly: 'id', name: 'id', hide:true},
                  { display: '生产派工号', name: 'zd001FormCode', width: 180 },
                  { display: '生产调度号', name: 'zd002OriCode', width: 180 },
 				  { display: 'PI编号', name: 'zd003PiCode', width: 160 },
		          { display: '客户名称', name: 'zd004CustomerName', width: 180},
		          { display: '单据状态', name: 'zd008Billstatus', width: 180,
                	  render: function (item){               		 
                		  var billStatus=item.zd008Billstatus;
                		  if(billStatus=="PRODISPAT_ZSAVE"){
                			  return "<span style='color:red;'>待派工</span>";
                		  }
                		  if(billStatus=="PRODISPAT_ZAUDIT"){
                			  return "<span style='color:red;'>部分派工</span>";
                		  }
                		  if(billStatus=="PRODISPAT_ZAPPROVE"){
                			  return "<span style='color:red;'>派工完成</span>";
                		  }
                		  if(billStatus=="PRODISPAT_ZEND"){
                			  return "<span style='color:red;'>完结</span>";
                		  }
                	  }
                  },
                  { display: '创建时间', name: 'bizCreatorDate', width: 120,
                	  render: function (item){
                		  var cdate=new Date(item.bizCreatorDate);
                		  return formatDate(cdate,"yyyy-MM-dd");
                	  }}
                 ],  
                      usePager: true,pageSize:15,pageSizeOptions :[10,20,30,40,50], 
                      enabledSort:false,enabledSort:true,
                      url : basic_Url+"/list.do?billSt=zv",
                      width: "100%", height:"98%", checkbox: true, rownumbers:true,     
                      onDblClickRow : function (data, rowindex, rowobj){
                    	  edit(data);
                      }
     });
	$("#pageloading").hide();
});

